<div id="content1" style="">
<div id="wrapper_friend" >
<h1 style="font-size: larger;">Tìm kiếm bạn bè</h1>
 <table>
<?php 
echo $this->Form->create('User',array('controller'=>'Users','action'=>'friend'));
echo $this->Form->input('Profile.name',array('label'=>'Tên'));
echo $this->Form->end('Tìm');?>
<br />
<?php
$friend=$this->requestAction('Users/friend');
$name=$this->requestAction('Users/view');
if($friend)
foreach ($friend as $fr):{?>
 <tr>
 <?php echo $this->Html->image($fr['Profile']['avatar'],array('alt'=>'CakePHP','width'=>'50px','height'=>'50px','class'=>'img-circle'));
       echo $fr['Profile']['name'];
       echo $this->Html->link('Kết bạn',array('controller'=>'FriendUsers','action'=>'addfriend',$name['User']['id'],$fr['User']['id']));
       
       ?>
       <br />
 </tr>
  
  
  
  
<?php }endforeach;
else echo 'Hệ thống chỉ có mỗi bạn';
?>
</table> 
</div> 
</div>